package com.enba.rbacadmin.module.auth.controller;

import com.enba.boot.core.base.Result;
import com.enba.rbacadmin.manager.CaptchaManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "验证码")
@RestController
@RequestMapping("/login")
public class CaptchaController {

  private final CaptchaManager captchaManager;

  public CaptchaController(CaptchaManager captchaManager) {
    this.captchaManager = captchaManager;
  }

  @ApiOperation("用户获取登陆验证码")
  @GetMapping("/captcha")
  public Result<Map<String, String>> loginCaptcha() {
    return Result.success(captchaManager.loginCaptcha());
  }
}
